<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Login</title>
</head>
<body>
<!--如果直接是 django 一条龙过来的页面，action 省略的就代表原 url
    如果自定义或者加参数，就只能手动写了
-->
<form action="{% url 'users:login' %}?next=/users/" method="post">
    {% csrf_token %}
    {% with errs=form.errors %}
        username: <input type="text" name="username" value="{{ form.username.value }}"><br/>
        <p>{{ errs.username }}</p>
        password: <input type="password" name="password" value="{{ form.password.value }}"><br/>
        <p>{{ errs.password }}</p>
        <input type="submit" value="Submit">
    {% endwith %}
</form>
<a href="{% url 'users:register' %}">没有账号,去注册</a>
<p>{{ form }}</p>
</body>
</html>